<%@ page pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:include page="../common/top.jsp"></jsp:include>
<jsp:include page="../common/leftmenu.jsp"></jsp:include>




<div class="fr" style="width: 780px">
	<div class="box_title">
		<i class="fa fa-table"></i>密码修改
	</div>
	<c:choose>
		<c:when test="${result.success eq false }">

			<div style="font-size: 18px;color:red;padding: 20px">提示信息：${result.data
				}</div>
		</c:when>

		<c:when test="${result.success eq true }">


			<script type="text/javascript">
				alert("密码修改成功！");
				window.location.href = "customer/help/user";
			</script>
		</c:when>


	</c:choose>
	<div class="box-content nopadding">
		<form id="changePasswordForm"
			action="customer/help/user/changePasswordSave" method="post">
			<div style="display: none">
				<input type="hidden" name="name" value="${name }">
			</div>

			<table class="form-table">
				<tr>
					<td class="td1"><label>现在的密码：</label></td>
					<td class="td2"><input id="oldPassword" type="password"
						name="oldPassword" placeholder="请输入原密码" class="required"><span
						class="required-tip"><font color="red"> * </font><font
							color="blue">必填 </font> </span></td>
				</tr>
				<tr>
					<td class="td1"><label>设置新的密码：</label></td>
					<td class="td2"><input id="newPassword1" type="password"
						name="newPassword1" placeholder="设置新的密码" class="required"><span
						class="required-tip"><font color="red"> * </font><font
							color="blue">必填 </font> </span></td>
				</tr>
				<tr>
					<td class="td1"><label>重复新的密码： </label></td>
					<td class="td2"><input id="newPassword2" type="password"
						name="newPassword2" placeholder="重复新的密码" class="required"><span
						class="required-tip"><font color="red"> * </font><font
							color="blue">必填 </font> </span></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;padding:10px"><input
						id="submitBtn" class="nui-mainbtn BUTTON SUBMIT" type="button"
						onclick="javascript:return submitChangePassword();"
						value="&nbsp;&nbsp;提交&nbsp;&nbsp;"> <span id="submiting"
						style="display:none;color:red;font-size:14px">正在提交，请稍候......</span>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>

<script type="text/javascript">
<!--
	function submitChangePassword() {

		var oldPassword = $("#oldPassword").val();
		var newPassword1 = $("#newPassword1").val();
		var newPassword2 = $("#newPassword2").val();
		if (oldPassword == "") {
			alert("请输入现在的密码！");
			return false;
		}

		if (newPassword1 == "" || newPassword2 == "") {
			alert("请输入新密码！");
			return false;
		}

		if (newPassword1.length < 6) {
			alert("新密码必须大于或者等于6位！");
			return false;
		}

		if (newPassword1 != newPassword2) {
			alert("新密码两次输入不一致！");
			return false;
		}

		$("#submitBtn").hide();
		$("#submiting").show();
		$("#changePasswordForm").submit();
		return true;
	}
//-->
</script>



<jsp:include page="../common/bottom.jsp"></jsp:include>